<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Base Sprite</title>
</head>
<body>
  <canvas id="mycanvas" width="600" height="600"></canvas>
  <script src="/js/sprite-core.js"></script>
  <script>
    const Sprite = spritejs.Sprite;
    const context = document.getElementById('mycanvas').getContext('2d');

    const s = new Sprite();
    s.attr({
      anchor: 0.5,
      size: [150, 150],
      pos: [150, 150],
      bgcolor: 'red',
    });
    s.connect(context).draw();
  </script>
</body>
</html>